

PYTHON=/usr/bin/python
LIBS=$(shell ls *.py)
VERSION=$(shell python -c "import TwoPartyLegislature as leg; print leg.__version__")
DISTFILE=PyVote_$(VERSION).zip

all:
	@echo "make doc:    Generate API documentation"
	@echo "make test:   Run unit tests"
	@echo "make clean:  Clean up generated files"
	@echo "make dist:   Create distributable"

doc: $(LIBS)
	epydoc -o doc $(LIBS)

test: $(LIBS)
	$(PYTHON) TwoPartyLegislature.py -v

dist: $(DISTFILE)

$(DISTFILE): $(LIBS)
	zip $(DISTFILE)  $(LIBS)

clean: 
	$(RM) *.pyc $(DISTFILE)
	$(RM) -r doc

